Scripts unit testing#184
Conversation
…Sys_Scripts into scripts_unit_testing
|
I've won my fight with github actions - over to @cameronbateman-mo |
yaswant
left a comment
There was a problem hiding this comment.
I see that this PR has already been merged. However, @james-bruten-mo , since you asked me to review the workflow, I have a few suggestions that could be addressed in a separate PR.
| name: Python Unit Tests | ||
|
|
||
| on: | ||
| pull_request: |
There was a problem hiding this comment.
Save the planet appeal :) - Only run if there is a change to Python files
| pull_request: | |
| pull_request: | |
| paths: | |
| - '**.py' | |
| - '.github/workflows/python_unit_tests.yaml' |
| python_unit_tests: | ||
| name: python_unit_tests | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 10 |
There was a problem hiding this comment.
| timeout-minutes: 10 | |
| timeout-minutes: 5 |
If it takes longer, it is not a unit test.
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.14' |
There was a problem hiding this comment.
| python-version: '3.14' | |
| python-version: '3.14' | |
| cache: 'pip' |
| pip install pytest | ||
| pip install networkx | ||
| pip install PyYAML |
There was a problem hiding this comment.
| pip install pytest | |
| pip install networkx | |
| pip install PyYAML | |
| pip install pytest networkx PyYAML |
| git config --global user.name 'Testing' | ||
| git config --global user.email 'Testing' |
There was a problem hiding this comment.
Do any of the tests require commit? If not, then simply remove the git configs
There was a problem hiding this comment.
Yeah a couple of them require these setting
PR Summary
Sci/Tech Reviewer: @cameronbateman-mo
Code Reviewer: @yaswant
This PR tidies up python unit tests in this repo and adds unit testing CI:
get_git_sources.pyapply_macros.pyunit tests so that they don't require an lfric_apps clone, updates them for changes since moving to git and expands the coverage.Code Quality Checklist
Testing
Security Considerations
AI Assistance and Attribution
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review